package com.czkt.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.czkt.entity.SalChance;
import com.czkt.mapper.SalChanceMapper;
import com.czkt.service.ISalChanceService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author jobob
 * @since 2024-06-18
 */
@Service
public class SalChanceServiceImpl extends ServiceImpl<SalChanceMapper, SalChance> implements ISalChanceService {
    @Resource
    SalChanceMapper salChanceMapper;

    @Override
    public IPage<SalChance> chanceIPage(String custName, String chcDesc,Long roleId, Integer pageIndex, Integer pageSize) {
        Page<SalChance> salChancePage = new Page<>(pageIndex,pageSize);
        return salChanceMapper.chanceIPage(salChancePage,custName,chcDesc,roleId);
    }

    @Override
    public void chanceInsert(SalChance salChance) {
        salChanceMapper.chanceInsert(salChance);
    }

    @Override
    public SalChance chanceEdit(String chcId) {
        return salChanceMapper.chanceEdit(chcId);
    }

    @Override
    public void toUpdateChance(SalChance salChance) {
        salChanceMapper.toUpdateChance(salChance);
    }

    @Override
    public void deleteByChcId(String chcId) {
        salChanceMapper.deleteByChcId(chcId);
    }
}
